1. Field of the Invention
The present invention relates to web applications. More specifically, the present invention relates to a method and an apparatus for dynamically updating a secondary form element in a web browser based on a selection in a primary form element.
2. Related Art
The explosive growth of the Internet, including the increasing availability of broadband connections, has made the Internet an effective tool for commerce and information exchange. Many companies and organizations now routinely sell products and disseminate information online. In most cases, these tasks involve a user entering information into web-based form, and subsequently submitting the information to a server. Quite often, information placed in certain fields in these forms depends on information placed in other fields. For example, the selection of state in the state field might limit the choices available in a city field, or the selection of the date in a date field might limit the time slots available in a requested appointment time field.
The task of dynamically modifying content based on user inputs has commonly been dealt with in two ways. In one method, the web page is pre-loaded with all of the choices for the secondary form field for each possible corresponding choice in the primary form field. For example, in the application where a user is required to pick a state and a city, the web page is pre-loaded with all of the states and their corresponding cities. When the user subsequently makes a selection in the state form field, the city form field is dynamically configured from the data already preloaded into the web page at the client to include only the cities that are in the selected state. This method, however, results in longer page loading times and, consequently, increases bandwidth utilization. Moreover, it consumes more memory at the client.
The second major method for dynamic modification of content based on user inputs is by updating the entire page after the first selection is made. For example, when a user chooses a state in the state field, the contents of the state field is submitted to the server, and the server returns a new page that includes the list of cities in the city field that correspond to the selected state. This new page is subsequently presented to the user. This method also increases bandwidth utilization because the entire page has to be reloaded. In addition, the user is presented with a blank screen while the page refreshes, and this method does not allow a user to complete the form out of order, because until the state is selected, the city selection list remains empty.
What is needed is a method and an apparatus for dynamically modifying content of a web page based on user interaction that does not exhibit the limitations listed above.